'''
    汉诺塔：移动塔数：n，初始塔：frompole,中间塔：withpole,目标塔：toPole
        移动策略：
            目标：将n个塔从初始塔移动到目标塔：n:fromPole-->withPole-->toPole
            1. 将n-1个塔从初始塔移动到中间塔，目标塔辅助：n-1：fromPole-->toPole-->withPole
            2. 将1个塔从初始塔直接移动到目标塔：1：fromPole-->toPole
'''


def moveTower(height,fromPole,withPole,toPole):
    if height > 1:
        moveTower(height-1,fromPole,toPole,withPole)    # n-1个塔移到中间塔
        move(fromPole,toPole)
        moveTower(height-1,withPole,fromPole,toPole)
    else:
        move(fromPole,toPole)

def move(p1,p2):

    print('move disk from ' + p1 + ' to ' + p2 + '  ---> step')


if __name__ == '__main__':
    moveTower(3,'A','B','C')